package com.yang.booking.service;

import com.yang.booking.dao.BiweeklyMapper;
import com.yang.booking.pojo.Biweekly;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@Service
public class BiweeklyService {

    @Autowired
    private BiweeklyMapper biweeklyMapper;

    public Map<String, Object> insertBiweekly(String name, int type){

        Biweekly biweekly = new Biweekly();
        biweekly.setName(name);
        biweekly.setType(type);
        biweekly.setCreateAt(new Date());
        biweekly.setUpdateAt(new Date());
        biweeklyMapper.insert(biweekly);

        Map<String, Object> msg = new HashMap<String, Object>();
        msg.put("massage", "插入成功");
        msg.put("code", 200);
        Map<String, Object> data = new HashMap<String, Object>();
        msg.put("data", data);

        return msg;
    }
}
